
var UserResetPasswordController = FormController.extend({
	_userModel : null,
	_location : null,
	_route : null,
	
	init : function($scope, userModel, $location, $route) {
		this._userModel = userModel;
		this._location = $location;
		this._route = $route;
		this._super($scope)
	},
	
	defineScope : function() {	
		this.$scope.resetPassword = this.resetPassword.bind(this);
	},
	
	resetPassword : function(passwords) {
		var passwordResetInfo = {
				'username' : this._route.current.params.username,
				'resetPassword' : passwords.changedPassword,
			}
		this._userModel.resetPassword(passwordResetInfo, function(data, status, headers, config) {
			this._location.path('/system/user-management');
		}.bind(this));
	}
})

UserResetPasswordController.$inject = ['$scope', 'UserModel', '$location', '$route'];